package com.bobamrz.service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

import javax.ws.rs.core.Response.StatusType;

import com.bobamrz.dao.DocStatusTypeDAO;
import com.bobamrz.domain.DocStatusType;

public class DocStatusService {
	
	private DocStatusTypeDAO statusTypeDAO = new DocStatusTypeDAO();
	
	public List<Map<String, String>> getAvailableStatuses() {
		List<DocStatusType> statusList = statusTypeDAO.getStatusTypesList();
		List<Map<String, String>> result = new ArrayList<Map<String, String>>();
		for(DocStatusType status : statusList) {
			Map<String, String> statusMap = new TreeMap<String, String>();
			statusMap.put("value", status.getDocStatusType()+"");
			statusMap.put("text", status.getTypeName());
			result.add(statusMap);
		}
		return result;
	}

}
